﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AddTarifa.aspx.cs" Inherits="NewTierra.Pages.AddTarifa" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">

    <link rel="shortcut icon" href="../../images/Icones/favicon.ico" type="image/x-icon" />

    <link href="../../Styles/jquery_notification.css" rel="stylesheet" />

    <link href="../../Styles/jquery-ui.css" rel="stylesheet" />    
    <script type="text/javascript" src="../../Scripts/jquery-1.11.0.js"></script>
    <script type="text/javascript" src="../../Scripts/jquery-ui-1.10.0.js"></script>

    <script type="text/javascript" src="../../Scripts/jquery_notification_v.1.js"></script>

    <link href="../../Styles/EstiloGeral.css" rel="stylesheet" type="text/css" />

    <title></title>
    <style type="text/css">
        #body
        {
            background-color: White;
            font-size: .80em;
            font-family: "Helvetica Neue", "Lucida Grande", "Segoe UI", Arial, Helvetica, Verdana, sans-serif;
            margin: 0px;
            padding: 0px;
            width: 1270px;
            height: 755px;
        }

        h1, h2, h3, h4, h5, h6
        {
            font-size: 1.5em;
            color: #666666;
            font-variant: small-caps;
            text-transform: none;
            font-weight: 200;
            margin-bottom: 0px;
        }

        #FormTarifa
        {
            height: 707px;
            width: 1220px;
            padding: 10px;
        }

            #FormTarifa .Cabecalho
            {
                width: 293px;
                float: left;
                height: 124px;
            }

            #FormTarifa .GridPeriodos
            {
                width: 867px;
                float: left;
                height: 124px;
            }

            #FormTarifa .FormCadastroMeal
            {
                float: left;
                height: 540px;
                width: 371px;
                margin-left: 15px;
            }

            #FormTarifa .FormCadastroTarifas
            {
                float: left;
                width: 450px;
                height: 540px;
            }

            #FormTarifa .GridMeal
            {
                height: 227px;
                float: left;
                width: 360px;
                margin-left: 15px;
            }

            #FormTarifa .GridTarifas
            {
                height: 226px;
                float: left;
                width: 433px;
            }

            #FormTarifa .FormBases
            {
                height: 540px;
                float: left;
                width: 359px;
                margin-left: 19px;
            }



        .invisible
        {
            display: none;
        }

        .scrollGridTarifas
        {
            width: 414px;
            height: 199px;
            overflow: auto;
        }

        .scrollGridPeriodos
        {
            width: 485px;
            height: 118px;
            overflow: auto;
        }

        .taxas
        {
            width: 405px;
        }

            .taxas .comissao
            {
                width: 77px;
                float: left;
                height: 42px;
            }

            .taxas .porcentagens
            {
                width: 170px;
                float: left;
            }

            .taxas .atualizarTaxas
            {
                width: 126px;
                height: 31px;
                float: left;
                margin-top: 15px;
            }

        .TipoTarifa_Categoria
        {
            width: 424px;
            height: 95px;
        }

            .TipoTarifa_Categoria .TipoTarifa
            {
                width: 114px;
                float: left;
            }

            .TipoTarifa_Categoria .Categoria
            {
                width: 261px;
                float: left;
                height: 52px;
            }

            .TipoTarifa_Categoria .TipoRoom
            {
                width: 130px;
                float: left;
                height: 43px;
            }

            .TipoTarifa_Categoria .TipoCadastro
            {
                width: 118px;
                float: left;
            }

        .TipoCadastro
        {
            width: 127px;
            height: 43px;
        }

        .DivBtns
        {
            height: 34px;
            width: 352px;
        }

        .ModalPopupBG
        {
            background-color: gray;
            filter: alpha(opacity=60);
            opacity: 0.7;
        }

        .ModalPopup
        {
            background-color: #fff;
            border-width: 1px;
            border-style: solid;
            border-color: #E6E6E6;
            padding: 3px;
            width: auto;
        }
    </style>
</head>
<body id="body">

    <script type="text/javascript">

        function CallServerCategoria() {
            document.getElementById('<%= btnFiltroNomeCategoria.ClientID %>').click();
        }

        function ShowIcon() {
            var e = document.getElementById("processing");
            e.style.visibility = (e.style.visibility == 'visible') ? 'hidden' : 'visible';
        }

        function showAutoCloseMessage(MsgsExc) {
            showNotification({
                message: MsgsExc,
                autoClose: true,
                type: "success",
                duration: 5
            });
        }

    </script>

    <form id="form1" runat="server">

        <asp:ScriptManager ID="ScriptManager1" runat="server" />

        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>

                <div id="FormTarifa">

                    <%--<asp:Timer ID="TimerCriticaSupplier" runat="server" Interval="10000" OnTick="CriticaSupplierTarifa">
                    </asp:Timer>--%>

                    <%--<asp:Button  id="btnCriticaSupplier" runat="server" Text="" style="display:none" OnClick="CriticaSupplierTarifa" />--%>

                    <h1>
                        <asp:Label ID="lblSupplierTarifaTXT" runat="server" Text="Supplier:" />
                        <span style="font-size: 20pt; color: #CC0000;">
                            <asp:Label ID="lblSupplierTarifa" runat="server" Text="" /></span>

                    </h1>
                    <hr />

                    <div class="Cabecalho">

                        <table>
                            <tr>
                                <td>
                                    <asp:Label ID="lblMercadoTXT" runat="server" Text="Mercado:"></asp:Label>
                                </td>
                                <td>
                                    <asp:Label ID="lblMercado" runat="server" Font-Size="Small" Text=""></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Label ID="lblBaseTarifariaTXT" runat="server" Text="Base Tarifária:"></asp:Label>
                                </td>
                                <td>
                                    <asp:Label ID="lblBaseTarifaria" runat="server" Font-Size="Small" Text=""></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Label ID="lblResponsavelTXT" runat="server" Text="Responsável:"></asp:Label>
                                </td>
                                <td>
                                    <asp:Label ID="lblResponsavel" runat="server" Font-Size="Small" Text=""></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Label ID="lblMinNoiteTXT" runat="server" Text="Mínimo Noites:"></asp:Label>
                                </td>
                                <td>
                                    <asp:Label ID="lblMinOrMand" runat="server" Text="" />
                                    <asp:Label ID="lblMinNoites" runat="server" Text="" />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Label ID="lblPromocaoTXT" runat="server" Text="Promoção:"></asp:Label>
                                </td>
                                <td>
                                    <asp:Label ID="lblPromocao" runat="server" Text="" />
                                </td>
                            </tr>
                        </table>

                        <%--<asp:Button ID="btnFecharTarifas" CssClass="btnGeralAzul" runat="server" Text="Fechar" OnClientClick="window.close();" />--%>
                    </div>

                    <div class="GridPeriodos">
                        <div class="scrollGridPeriodos">
                            <asp:GridView ID="GridTarifasPeriodo"
                                runat="server"
                                AutoGenerateColumns="False"
                                GridLines="None"
                                CssClass="mGrid"
                                EmptyDataText="Não existe Periodos para esse Supplier."
                                Height="16px"
                                Width="94px"
                                PageSize="3"
                                OnSelectedIndexChanged="GridTarifasPeriodo_SelectedIndexChanged">

                                <AlternatingRowStyle CssClass="alt"></AlternatingRowStyle>
                                <SelectedRowStyle CssClass="SelectedRowStyle" />
                                <Columns>

                                    <asp:BoundField DataField="S_merc_periodo_id" HeaderText="ID" ReadOnly="True"
                                        SortExpression="S_merc_periodo_id" InsertVisible="False">

                                        <FooterStyle CssClass="invisible" />
                                        <HeaderStyle CssClass="invisible" />
                                        <ItemStyle CssClass="invisible" />
                                    </asp:BoundField>

                                    <asp:BoundField DataField="S_merc_periodo_from" HeaderText="From"
                                        SortExpression="S_merc_periodo_from" DataFormatString="{0:dd/MM/yy}">

                                        <ItemStyle Wrap="False" />
                                    </asp:BoundField>

                                    <asp:BoundField DataField="S_merc_periodo_to" HeaderText="To"
                                        SortExpression="S_merc_periodo_to" DataFormatString="{0:dd/MM/yy}">

                                        <ItemStyle Wrap="False" />
                                    </asp:BoundField>

                                    <asp:BoundField DataField="S_mercado_estacao_nome" HeaderText="Estação"
                                        SortExpression="S_mercado_estacao_nome">

                                        <ItemStyle Wrap="False" />
                                    </asp:BoundField>

                                    <asp:BoundField DataField="S_merc_periodo_fdsFrom" HeaderText="Fds From"
                                        SortExpression="S_merc_periodo_fdsFrom"
                                        DataFormatString="{0:dd/MM/yy}">
                                        <HeaderStyle Wrap="False" />
                                        <ItemStyle Wrap="False" />
                                    </asp:BoundField>

                                    <asp:BoundField DataField="S_merc_periodo_fdsTo" HeaderText="Fds To"
                                        SortExpression="S_merc_periodo_fdsTo" DataFormatString="{0:dd/MM/yy}">
                                        <HeaderStyle Wrap="False" />
                                        <ItemStyle Wrap="False" />
                                    </asp:BoundField>

                                    <asp:BoundField DataField="Pacote_nome" HeaderText="Pacote" SortExpression="Pacote_nome">
                                        <HeaderStyle Wrap="True" />
                                        <ItemStyle Wrap="True" />
                                    </asp:BoundField>

                                    <asp:CommandField ShowSelectButton="True" ButtonType="Image" SelectImageUrl="~/images/Icones/edit.png" />

                                </Columns>

                                <PagerStyle CssClass="pgr"></PagerStyle>

                            </asp:GridView>
                        </div>

                    </div>

                    <div class="FormCadastroTarifas">

                        <fieldset style="height: 320px">
                            <legend>Adicionar Tarifas</legend>

                            <div class="TipoTarifa_Categoria">

                                <div class="TipoTarifa">
                                    <asp:Label ID="lblTipoTarifa" runat="server" Text="Tipo Tarifa:"></asp:Label><br />
                                    <asp:DropDownList ID="DropTipoTarifa" runat="server"></asp:DropDownList>
                                </div>

                                <div class="Categoria">
                                    <asp:Label ID="lblCategoria" runat="server" Text="Categoria:"></asp:Label>
                                    &nbsp;
                                    <asp:LinkButton ID="lnkAddCategoria" runat="server" Text="Add" OnClick="AddCategoria" />
                                    <asp:LinkButton ID="lnkCancelCategoria" runat="server" Text="Cancelar" OnClick="CancelCategoria" Visible="false" /><br />
                                    <asp:DropDownList ID="DropCategoria" runat="server" Width="200px">
                                    </asp:DropDownList>
                                    <asp:TextBox ID="txtAddCategoria" runat="server" Visible="false" />
                                    <asp:Button ID="btnAddCategoria" CssClass="btnGeralAzul" runat="server" Visible="false" Text="Salvar" OnClick="SalvarCategoria" />
                                    <ajaxToolkit:AutoCompleteExtender
                                        ServiceMethod="SearchCategorias"
                                        MinimumPrefixLength="1"
                                        CompletionInterval="100"
                                        EnableCaching="False"
                                        TargetControlID="txtAddCategoria"
                                        OnClientPopulating="ShowIcon"
                                        OnClientPopulated="ShowIcon"
                                        ID="AutoCompleteCategorias"
                                        runat="server"
                                        OnClientItemSelected="CallServerCategoria"
                                        DelimiterCharacters=""
                                        Enabled="True"
                                        ServicePath="">
                                    </ajaxToolkit:AutoCompleteExtender>

                                    <img id="processing" alt="load" style="visibility: hidden"
                                        src="../../images/ajax-loader.gif" />
                                    <asp:Button ID="btnFiltroNomeCategoria" runat="server" Text="" OnClick="SelectCategoria" Style="display: none;" />

                                </div>


                                <div class="TipoRoom">
                                    <asp:Label ID="lblTipoRoom" runat="server" Text="Tipo Room:"></asp:Label><br />
                                    <asp:DropDownList ID="DropTipoRoom" runat="server"
                                        AutoPostBack="True" OnSelectedIndexChanged="DropTipoRoom_SelectedIndexChanged">
                                    </asp:DropDownList>
                                </div>

                                <div class="TipoCadastro">
                                    <asp:Label ID="lblTipoCadastro" runat="server" Text="Tipo Cadastro" /><br />
                                    <asp:DropDownList ID="ddlTipoCadastro" runat="server" AutoPostBack="true" OnSelectedIndexChanged="MudaTipoCadastro">
                                        <asp:ListItem Value="Valor" Selected="True">Valor</asp:ListItem>
                                        <asp:ListItem Value="Status">Status</asp:ListItem>
                                    </asp:DropDownList>
                                </div>

                                <div class="TipoRoom">

                                    <asp:Button ID="btnOpenModalPoliticaCHD" runat="server" Text="" Style="display: none;" />
                                    <asp:Button ID="btnPoliticaCHD" runat="server" CssClass="btnGeralAzul" Text="CHD" OnClick="btnPoliticaCHD_Click" />

                                    <asp:Button ID="btnOpenModalTC" runat="server" Text="" Style="display: none;" />
                                    <asp:Button ID="btnTC" runat="server" CssClass="btnGeralAzul" Text="TC" OnClick="btnTC_Click" />

                                    <asp:Button ID="btnListPoliticaCHD" runat="server" CssClass="btnGeralAzul" Text="List" OnClick="btnListPoliticaCHD_Click" Visible="false" />
                                </div>


                            </div>


                            <asp:Panel ID="PanelPoliticaCHD" runat="server" CssClass="ModalPopup" Style="display: none; width: auto; height: auto; overflow-x: hidden; overflow-y: auto; border-radius: 5px;">

                                <asp:ImageButton ID="btnImgFecharModalPoliticaCHD" ToolTip="Fechar" runat="server" ImageUrl="../../images/Icones/close2.png" Width="20px" Height="20px" OnClick="FechaModalPoliticaCHD" />

                                <fieldset>
                                    <legend>Cadastrar Política de CHD</legend>

                                    <asp:Panel ID="PanelPoliticaCHDGrid" runat="server">

                                        <table>
                                            <tr>
                                                <td>
                                                    <asp:Label ID="lblQtdCHDsModal" runat="server" Text="CHDs" />
                                                </td>
                                                <td></td>
                                                <td>
                                                    <asp:Label ID="lblIdadeCHDsModalDe" runat="server" Text="De" />
                                                </td>
                                                <td>
                                                    <asp:Label ID="lblIdadeCHDsModalAte" runat="server" Text="Até" />
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    <asp:DropDownList ID="ddlQtdChds" runat="server" />
                                                </td>
                                                <td style="width: 30px; text-align: center;">até
                                                </td>
                                                <td>
                                                    <asp:DropDownList ID="ddlIdadeChdsDe" runat="server" />
                                                </td>
                                                <td>
                                                    <asp:DropDownList ID="ddlIdadeChdsAte" runat="server" />
                                                </td>
                                            </tr>
                                        </table>

                                        <table>
                                            <tr>
                                                <td>
                                                    <asp:Label ID="lblTipoValorCHD" runat="server" Text="Tipo" />
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    <asp:DropDownList ID="ddlTipoValorPoliticaCHD" runat="server" AppendDataBoundItems="true">
                                                        <asp:ListItem Selected="True" Value="0" Text="Free" />
                                                        <asp:ListItem Value="1" Text="Valor" />
                                                        <asp:ListItem Value="2" Text="Percent" />
                                                    </asp:DropDownList>
                                                </td>
                                                <td>
                                                    <asp:TextBox ID="txtValorPoliticaCHD" placeholder="Valor" runat="server" MaxLength="10" Width="80px" />

                                                    <%-- <asp:RequiredFieldValidator ID="RqValorPoliticaCHD" runat="server" ErrorMessage="*" ValidationGroup="SalvarPoliticaCHD" CssClass="MsgErro"
                                                        ControlToValidate="txtValorPoliticaCHD" ToolTip="Campo requerido." />--%>

                                                </td>
                                            </tr>
                                        </table>

                                        <table>
                                            <tr>
                                                <td style="vertical-align: bottom;">
                                                    <asp:Button ID="btnSalvarPoliticaChd" CssClass="btnGeralAzul" runat="server" Text="Salvar" ValidationGroup="SalvarPoliticaCHD" OnClick="SalvarPoliticaChd" />

                                                    <asp:Button ID="btnSalvarPoliticaChdTarifa" CssClass="btnGeralAzul" runat="server" Text="Salvar na tarifa" ValidationGroup="SalvarPoliticaCHD" OnClick="SalvarPoliticaChdTarifa" Visible="false" />

                                                    <asp:Button ID="btnSalvarPoliticaChdTodoPeriodo" CssClass="btnGeralAzul" runat="server" Text="Salvar todo período" OnClick="SalvarPoliticaChdTodoPeriodo" Visible="false" />

                                                    <asp:Button ID="btnSalvarPoliticaChdTodoHotel" CssClass="btnGeralAzul" runat="server" Text="Salvar todo Hotel" OnClick="SalvarPoliticaChdTodoHotel" Visible="false" />

                                                    <asp:Button ID="btnRemoverPoliticaChd" CssClass="btnGeralAzul" runat="server" Text="Remover" OnClick="btnRemoverPoliticaChd_Click" Visible="false" />
                                                </td>
                                            </tr>
                                        </table>

                                    </asp:Panel>

                                    <div style="overflow-x: auto; overflow-y: auto; height: 300px; width: 380px;">
                                        <asp:GridView ID="GridPoliticasCHDCadastro" runat="server"
                                            AutoGenerateColumns="False" GridLines="None" CssClass="mGrid" EmptyDataText="Não existe política cadastrada."
                                            Height="16px" Width="94px">
                                            <AlternatingRowStyle CssClass="alt"></AlternatingRowStyle>
                                            <Columns>

                                                <asp:BoundField DataField="S_politicaCHD_qtd" HeaderText="Nr Chds">
                                                    <HeaderStyle Wrap="False" />
                                                </asp:BoundField>
                                                <asp:BoundField DataField="S_politicaCHD_idadeDe" HeaderText="De" />
                                                <asp:BoundField DataField="S_politicaCHD_idade" HeaderText="Até" />
                                                <asp:BoundField DataField="S_politicaCHD_free" HeaderText="Free" />
                                                <asp:BoundField DataField="S_politicaCHD_valor" HeaderText="Valor" />
                                                <asp:BoundField DataField="S_politicaCHD_percent" HeaderText="Percent" />

                                                <asp:TemplateField HeaderText="Adicionar">

                                                    <ItemTemplate>
                                                        <asp:Label ID="lblIdPolitica" runat="server" Text='<%# Eval("S_politicaCHD_id") %>' Visible="false" />
                                                        <asp:CheckBox ID="chkChecado" runat="server" />

                                                    </ItemTemplate>

                                                </asp:TemplateField>

                                                <asp:TemplateField HeaderText="">
                                                    <ItemTemplate>
                                                        <asp:ImageButton ID="lnkEditarPolitica" ToolTip="Editar Política"
                                                            runat="server" ImageUrl="~/images/Icones/edit.png"
                                                            CommandArgument='<%# Eval("S_politicaCHD_id") %>'
                                                            OnCommand="EditarPoliticaCHD" />
                                                    </ItemTemplate>
                                                    <HeaderStyle Wrap="False" />
                                                    <ItemStyle Wrap="False" />
                                                </asp:TemplateField>

                                                <asp:TemplateField HeaderText="">
                                                    <ItemTemplate>
                                                        <asp:ImageButton ID="ExluirPolitica" ToolTip="Excluir Política"
                                                            runat="server" CommandArgument='<%# Eval("S_politicaCHD_id") %>'
                                                            OnCommand="ExcluirPoliticaCHD"
                                                            ImageUrl="~/images/Icones/delete.png" />
                                                    </ItemTemplate>
                                                    <HeaderStyle Wrap="False" />
                                                    <ItemStyle Wrap="False" />
                                                </asp:TemplateField>

                                            </Columns>
                                        </asp:GridView>
                                    </div>

                                </fieldset>

                            </asp:Panel>

                            <ajaxToolkit:ModalPopupExtender
                                ID="ModalPopupExtenderPoliticaChd"
                                runat="server"
                                BackgroundCssClass="ModalPopupBG"
                                DropShadow="false"
                                Enabled="True"
                                PopupControlID="PanelPoliticaCHD"
                                PopupDragHandleControlID="PopupHeader"
                                RepositionMode="RepositionOnWindowResizeAndScroll"
                                Drag="true"
                                TargetControlID="btnOpenModalPoliticaCHD" X="400" Y="250">
                            </ajaxToolkit:ModalPopupExtender>


                            <asp:Panel ID="PanelPoliticaTC" runat="server" CssClass="ModalPopup" Style="display: none; width: auto; height: auto; overflow-x: hidden; overflow-y: auto; border-radius: 5px;">

                                <asp:ImageButton ID="btnImgFecharModalPoliticaTC" ToolTip="Fechar" runat="server" OnClick="FechaModalPoliticaTC" ImageUrl="../../images/Icones/close2.png" Width="20px" Height="20px"/>

                                <fieldset>
                                    <legend>Cadastrar Política de TC</legend>

                                    <asp:Panel ID="Panel2" runat="server">

                                        <table>
                                            <tr>
                                                <td>
                                                    <asp:Label ID="lblQtdTCs" runat="server" Text="TCs" />
                                                </td>                                                                                            
                                            </tr>
                                            <tr>
                                                <td>
                                                    <asp:DropDownList ID="ddlQtdTCs" runat="server" />
                                                </td>                                               
                                            </tr>
                                        </table>

                                        <table>
                                            <tr>
                                                <td>
                                                    <asp:Label ID="lblPoliticaTcTipo" runat="server" Text="Tipo" />
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    <asp:DropDownList ID="ddlTipoValorPoliticaTC" runat="server" AppendDataBoundItems="true">
                                                        <asp:ListItem Selected="True" Value="0" Text="Free" />
                                                        <asp:ListItem Value="1" Text="Valor" />
                                                        <asp:ListItem Value="2" Text="Percent" />
                                                    </asp:DropDownList>
                                                </td>
                                                <td>
                                                    <asp:TextBox ID="txtValorPoliticaTC" placeholder="Valor" runat="server" MaxLength="10" Width="80px" />                                                   

                                                </td>
                                            </tr>
                                        </table>

                                        <table>
                                            <tr>
                                                <td style="vertical-align: bottom;">
                                                    <asp:Button ID="SalvarPoliticaTC" CssClass="btnGeralAzul" runat="server" Text="Salvar" ValidationGroup="SalvarPoliticaTC" OnClick="btnSalvarPoliticaTC_Click" />

                                                    <asp:Button ID="SalvarPoliticaTCTarifa" CssClass="btnGeralAzul" runat="server" Text="Salvar na tarifa" ValidationGroup="SalvarPoliticaTC" OnClick="btnSalvarPoliticaTCTarifa_Click" Visible="false" />

                                                    <asp:Button ID="SalvarPoliticaTCTodoPeriodo" CssClass="btnGeralAzul" runat="server" Text="Salvar todo período" OnClick="btnSalvarPoliticaTCTodoPeriodo_Click" Visible="false" />

                                                    <asp:Button ID="SalvarPoliticaTCTodoHotel" CssClass="btnGeralAzul" runat="server" Text="Salvar todo Hotel" OnClick="btnSalvarPoliticaTCTodoHotel_Click" Visible="false" />

                                                    <asp:Button ID="btnRemoverPoliticaTC" CssClass="btnGeralAzul" runat="server" Text="Remover" OnClick="btnRemoverPoliticaTC_Click" Visible="false" />
                                                </td>
                                            </tr>
                                        </table>

                                    </asp:Panel>

                                    <div style="overflow-x: auto; overflow-y: auto; height: 300px; width: 380px;">
                                        <asp:GridView ID="GridPoliticasTCCadastro" runat="server"
                                            AutoGenerateColumns="False" GridLines="None" CssClass="mGrid" EmptyDataText="Não existe política cadastrada."
                                            Height="16px" Width="94px">
                                            <AlternatingRowStyle CssClass="alt"></AlternatingRowStyle>
                                            <Columns>

                                                <asp:BoundField DataField="S_politicaTC_qtd" HeaderText="Nr Chds">
                                                    <HeaderStyle Wrap="False" />
                                                </asp:BoundField>
                                                <asp:BoundField DataField="S_politicaTC_idadeDe" HeaderText="De" />
                                                <asp:BoundField DataField="S_politicaTC_idade" HeaderText="Até" />
                                                <asp:BoundField DataField="S_politicaTC_free" HeaderText="Free" />
                                                <asp:BoundField DataField="S_politicaTC_valor" HeaderText="Valor" />
                                                <asp:BoundField DataField="S_politicaTC_percent" HeaderText="Percent" />

                                                <asp:TemplateField HeaderText="Adicionar">

                                                    <ItemTemplate>
                                                        <asp:Label ID="lblIdPolitica" runat="server" Text='<%# Eval("S_politicaTC_id") %>' Visible="false" />
                                                        <asp:CheckBox ID="chkChecado" runat="server" />

                                                    </ItemTemplate>

                                                </asp:TemplateField>

                                                <asp:TemplateField HeaderText="">
                                                    <ItemTemplate>
                                                        <asp:ImageButton ID="lnkEditarPolitica" ToolTip="Editar Política"
                                                            runat="server" ImageUrl="~/images/Icones/edit.png"
                                                            CommandArgument='<%# Eval("S_politicaTC_id") %>'
                                                            OnCommand="lnkEditarPolitica_Command" />
                                                    </ItemTemplate>
                                                    <HeaderStyle Wrap="False" />
                                                    <ItemStyle Wrap="False" />
                                                </asp:TemplateField>

                                                <asp:TemplateField HeaderText="">
                                                    <ItemTemplate>
                                                        <asp:ImageButton ID="ExluirPolitica" ToolTip="Excluir Política"
                                                            runat="server" CommandArgument='<%# Eval("S_politicaTC_id") %>'
                                                            OnCommand="ExluirPolitica_Command"
                                                            ImageUrl="~/images/Icones/delete.png" />
                                                    </ItemTemplate>
                                                    <HeaderStyle Wrap="False" />
                                                    <ItemStyle Wrap="False" />
                                                </asp:TemplateField>

                                            </Columns>
                                        </asp:GridView>
                                    </div>

                                </fieldset>

                            </asp:Panel>

                            <ajaxToolkit:ModalPopupExtender
                                ID="ModalPopupExtenderPoliticaTC"
                                runat="server"
                                BackgroundCssClass="ModalPopupBG"
                                DropShadow="false"
                                Enabled="True"
                                PopupControlID="PanelPoliticaTC"
                                PopupDragHandleControlID="PopupHeader"
                                RepositionMode="RepositionOnWindowResizeAndScroll"
                                Drag="true"
                                TargetControlID="btnOpenModalTC" X="400" Y="250">
                            </ajaxToolkit:ModalPopupExtender>


                            <asp:Panel ID="PanelPorcentagemTarifas" runat="server" Width="406px" Height="69px">

                                <asp:RadioButtonList ID="RdoTarifa" runat="server" AutoPostBack="True"
                                    RepeatDirection="Horizontal" Width="250px" Height="16px"
                                    OnSelectedIndexChanged="RdoTarifa_SelectedIndexChanged">
                                    <asp:ListItem Value="0">Por Pessoa</asp:ListItem>
                                    <asp:ListItem Value="1" Selected="True">Por Apartamento</asp:ListItem>
                                </asp:RadioButtonList>

                                <div class="taxas">
                                    <div class="porcentagens">
                                        <asp:Label ID="lblPorcetagemTarifaTXT" runat="server" Text="Taxas:"></asp:Label><br />
                                        <asp:TextBox ID="txtPorcentagemTaxa" runat="server" Width="50px">0</asp:TextBox>
                                        %&nbsp;&nbsp;&nbsp;
                        <asp:TextBox ID="txtPorcentagemImposto" runat="server" Width="50px">0</asp:TextBox>
                                        % 
                                    </div>
                                    <div class="comissao">
                                        <asp:Label ID="lblComissaoTXT" runat="server" Text="Comissão:"></asp:Label><br />
                                        <asp:TextBox ID="txtComissao" runat="server" Width="50px" Text="0" />
                                        %
                                    </div>

                                    <div class="atualizarTaxas">
                                        <asp:ImageButton ID="ImgAtualizaTaxas" runat="server" ImageUrl="~/images/Icones/refresh-icon.png" OnClick="AtualizarTaxas" ToolTip="Atualizar Taxas" />
                                    </div>

                                    <br />
                                </div>
                            </asp:Panel>

                            <asp:Label ID="lblStatusTarifaTXT" runat="server" Text="Status/Tarifa:"></asp:Label><br />
                            <asp:TextBox ID="txtStatusTarifa" runat="server" Width="50px"
                                AutoPostBack="True" OnTextChanged="txtStatusTarifa_TextChanged"></asp:TextBox>
                            <asp:RequiredFieldValidator
                                ID="requiredTarifa"
                                runat="server"
                                ErrorMessage="*"
                                ToolTip="Campo requerido."
                                ValidationGroup="SalvarTarifa"
                                CssClass="MsgErro"
                                ControlToValidate="txtStatusTarifa" />

                            <asp:Label ID="lblErroStatusValorTarifa" runat="server" Text=""></asp:Label>

                            &nbsp;<asp:Label ID="lblTotalTarifaTXT" runat="server" Text="Total:"></asp:Label>
                            <asp:TextBox ID="txtStatusTarifaTotal" runat="server" Width="50px"
                                Enabled="False"></asp:TextBox>
                            <asp:DropDownList ID="DropStatusTarif" runat="server" Visible="False">
                            </asp:DropDownList>

                            <asp:CheckBox ID="chkDividePacote" runat="server" Text="Divide valor por número de noites??" Visible="false" />
                            <br />
                            <br />

                            <div class="DivBtns">
                                <asp:Button ID="btnSalvarTarifa" CssClass="btnGeralAzul" runat="server" Text="Salvar"
                                    ValidationGroup="SalvarTarifa" OnClick="SalvarTarifa" />

                                <asp:Button ID="btnAtualizarTarifa" CssClass="btnGeralAzul" runat="server" Text="Atualizar"
                                    ValidationGroup="Salvar" OnClick="AtualizarTarifa" />

                                <asp:Button ID="btnOrdernarTarifas" CssClass="btnGeralAzul" runat="server" Text="Ordenar Tarifas" />

                                <%--<asp:Button ID="btnExcluirTarifa" CssClass="btnGeralAzul" runat="server" Text="Excluir"
                                    ValidationGroup="Salvar" OnClick="ExcluirTarifa" />--%>
                            </div>

                            <asp:Panel ID="PanelOrdenarTarifas" runat="server" CssClass="ModalPopup" Style="display: none; width: 260px; height: 230px; overflow-x: hidden; overflow-y: auto; border-radius: 5px;">

                                <asp:ImageButton ID="btnImgFecharModal" ToolTip="Fechar" runat="server" ImageUrl="../../images/Icones/close2.png" Width="20px" Height="20px" />

                                <iframe id="IFRAME3" src="AddOrdemTarifas.aspx" frameborder="0" scrolling="no"
                                    border="0" cellspacing="0"
                                    style="border-style: none; width: 260px; height: 220px; margin-left: 0px;"></iframe>
                            </asp:Panel>

                            <ajaxToolkit:ModalPopupExtender
                                ID="ModalPopupExtenderOrdenarTarifa"
                                runat="server"
                                BackgroundCssClass="ModalPopupBG"
                                CancelControlID="btnImgFecharModal"
                                DropShadow="false"
                                Enabled="True"
                                PopupControlID="PanelOrdenarTarifas"
                                PopupDragHandleControlID="PopupHeader"
                                RepositionMode="RepositionOnWindowResizeAndScroll"
                                Drag="true"
                                TargetControlID="btnOrdernarTarifas" X="20" Y="20">
                            </ajaxToolkit:ModalPopupExtender>

                            <asp:Label ID="lblMsgAddTarifa" runat="server" Font-Bold="True"
                                ForeColor="#CC0000" Font-Size="Small"></asp:Label>

                        </fieldset>

                        <br />
                        <asp:Label ID="lblMoedaTXT" runat="server" Text="Moeda:"></asp:Label>
                        &nbsp;<asp:Label ID="lblMoeda" runat="server" CssClass="MsgErro" Text=""></asp:Label><br />
                        <br />

                        <fieldset>
                            <legend>Tarifas Cadastradas</legend>
                            <div class="scrollGridTarifas">

                                <asp:ImageButton ID="imgAtualizaGridTarifas" runat="server" ImageUrl="~/images/Icones/refresh-icon.png" OnClick="AtualizarGridTarifas" ToolTip="Atualizar Tarifas" />

                                <asp:GridView ID="GridTarifas" runat="server" AllowPaging="True"
                                    AutoGenerateColumns="False" GridLines="None" CssClass="mGrid" EmptyDataText="Não existe Tarifa cadastrada para esse periodo."
                                    Height="16px"
                                    Width="228px" PageSize="50"
                                    OnSelectedIndexChanged="GridTarifas_SelectedIndexChanged"
                                    OnRowDataBound="GridTarifas_RowDataBound">
                                    <AlternatingRowStyle CssClass="alt"></AlternatingRowStyle>
                                    <SelectedRowStyle CssClass="SelectedRowStyle" />
                                    <Columns>
                                        <asp:BoundField DataField="S_merc_tarif_id" HeaderText="ID" SortExpression="S_merc_tarif_id">
                                            <HeaderStyle CssClass="invisible" />
                                            <FooterStyle CssClass="invisible" />
                                            <ItemStyle CssClass="invisible" />
                                        </asp:BoundField>

                                        <asp:BoundField DataField="S_mercado_tipo_tarifa_nome" HeaderText="Tarifa Nome" SortExpression="S_mercado_tipo_tarifa_nome">
                                            <HeaderStyle Wrap="False" />
                                            <ItemStyle Wrap="False" />

                                        </asp:BoundField>

                                        <asp:BoundField DataField="Tarif_categoria_nome" HeaderText="Categoria"
                                            SortExpression="Tarif_categoria_nome">

                                            <ItemStyle Wrap="False" />
                                        </asp:BoundField>

                                        <asp:BoundField DataField="Tipo_room_nome" HeaderText="Room" SortExpression="Tipo_room_nome">
                                            <ItemStyle Wrap="False" />

                                        </asp:BoundField>

                                        <asp:BoundField DataField="S_merc_tarif_tarifa_total" HeaderText="Tarifa" SortExpression="S_merc_tarif_tarifa_total"></asp:BoundField>

                                        <asp:BoundField DataField="S_mercado_tarifa_status_nome" HeaderText="Status" SortExpression="S_mercado_tarifa_status_nome">

                                            <ItemStyle Wrap="False" />
                                        </asp:BoundField>

                                        <asp:TemplateField HeaderText="">
                                            <ItemTemplate>
                                                <asp:ImageButton ID="OpenPoliticaCHD" ToolTip="Política CHD"
                                                    runat="server" CommandArgument='<%# Eval("S_merc_tarif_id") %>'
                                                    OnCommand="OpenPoliticaCHD" />
                                            </ItemTemplate>
                                            <HeaderStyle Wrap="False" />
                                            <ItemStyle Wrap="False" />
                                        </asp:TemplateField>

                                         <asp:TemplateField HeaderText="">
                                            <ItemTemplate>
                                                <asp:ImageButton ID="OpenPoliticaTC" ToolTip="Política TC"
                                                    runat="server" CommandArgument='<%# Eval("S_merc_tarif_id") %>'
                                                    OnCommand="OpenPoliticaTC" />
                                            </ItemTemplate>
                                            <HeaderStyle Wrap="False" />
                                            <ItemStyle Wrap="False" />
                                        </asp:TemplateField>

                                        <asp:CommandField ShowSelectButton="True" SelectText="Editar" ButtonType="Image" SelectImageUrl="~/images/Icones/edit.png" />

                                        <asp:TemplateField HeaderText="">
                                            <ItemTemplate>
                                                <asp:ImageButton ID="ExluirTarifa" ToolTip="Excluir Tarifa"
                                                    runat="server" CommandArgument='<%# Eval("S_merc_tarif_id") %>'
                                                    OnCommand="ExluirTarifa"
                                                    ImageUrl="~/images/Icones/delete.png" />
                                            </ItemTemplate>
                                            <HeaderStyle Wrap="False" />
                                            <ItemStyle Wrap="False" />
                                        </asp:TemplateField>

                                    </Columns>

                                    <PagerStyle CssClass="pgr"></PagerStyle>

                                </asp:GridView>

                            </div>
                        </fieldset>

                    </div>

                    <div class="FormCadastroMeal">

                        <fieldset style="height: 302px">
                            <legend>Adicionar Meal</legend>

                            <asp:Label ID="lblTipoMealTXT" runat="server" Text="Meal:"></asp:Label><br />
                            <asp:DropDownList ID="DropMeal" runat="server">
                            </asp:DropDownList>

                            <br />

                            <asp:Label ID="lblTipoCadastroMeal" runat="server" Text="Tipo Cadastro" /><br />
                            <asp:DropDownList ID="ddlTipoCadastroMeal" runat="server" AutoPostBack="true" OnSelectedIndexChanged="MudaTipoCadastroMeal">
                                <asp:ListItem Value="Valor" Selected="True">Valor</asp:ListItem>
                                <asp:ListItem Value="Status">Status</asp:ListItem>
                            </asp:DropDownList>

                            <br />

                            <asp:Panel ID="PanelPorcentagemMeal" runat="server">
                                <asp:Label ID="lblPorcetagemMealTXT" runat="server" Text="Taxas:"></asp:Label><br />
                                <asp:TextBox ID="txtPorcentagemTaxaMeal" runat="server" Width="50px">0</asp:TextBox>
                                %&nbsp;&nbsp;&nbsp;
                        <asp:TextBox ID="txtPorcentagemImpostoMeal" runat="server" Width="50px">0</asp:TextBox>
                                %

                                <asp:ImageButton ID="imgAtualizarTaxasMeal" runat="server" ImageUrl="~/images/Icones/refresh-icon.png" OnClick="AtualizarTaxasMeal" ToolTip="Atualizar Taxas" />

                                <br />
                            </asp:Panel>

                            <asp:Label ID="lblStatusMealTXT" runat="server" Text="Status/Tarifa:"></asp:Label><br />

                            <asp:TextBox ID="txtStatusMeal" runat="server"
                                AutoPostBack="True" OnTextChanged="txtStatusMeal_TextChanged" Width="50px"></asp:TextBox>
                            <asp:RequiredFieldValidator
                                ID="requiredStatusMeal"
                                runat="server"
                                ErrorMessage="*"
                                ToolTip="Campo requerido."
                                ValidationGroup="SalvarMeal"
                                ControlToValidate="txtStatusMeal" CssClass="MsgErro" />

                            <asp:Label ID="lblErroStatusValorMeal" runat="server" Text="" />
                            &nbsp;<asp:Label ID="lblTotalMealTXT" runat="server" Text="Total:"></asp:Label>
                            <asp:TextBox ID="txtStatusMealTotal" runat="server" Width="50px"
                                Enabled="False"></asp:TextBox>


                            <%-- <asp:CheckBox ID="chkValorMeal" runat="server" Text="Valor?"
                                AutoPostBack="True" OnCheckedChanged="chkValorMeal_CheckedChanged" />--%>

                            <asp:DropDownList ID="DropStatusMeal" runat="server" Visible="False">
                            </asp:DropDownList>
                            <br />
                            <br />

                            <div class="DivBtns">

                                <asp:Button ID="btnSalvarMeal" CssClass="btnGeralAzul" runat="server" Text="Salvar"
                                    ValidationGroup="SalvarMeal" OnClick="SalvarMeal" />

                                <asp:Button ID="btnAtualizarMeal" CssClass="btnGeralAzul" runat="server" Text="Atualizar"
                                    ValidationGroup="Salvar" OnClick="AtualizarMeal" />

                                <%--<asp:Button ID="btnExcluirMeal" CssClass="btnGeralAzul" runat="server" Text="Excluir"
                                    ValidationGroup="Salvar" OnClick="ExcluirMeal" />--%>
                            </div>

                            <asp:Label ID="lblMsgAddMeal" runat="server" Font-Bold="True"
                                ForeColor="#CC0000" Font-Size="Small"></asp:Label>


                        </fieldset>

                        <fieldset>
                            <legend>Meals Cadastrados</legend>
                            <asp:GridView ID="GridMeal" runat="server" AllowPaging="True"
                                AutoGenerateColumns="False" GridLines="None" CssClass="mGrid" EmptyDataText="Não existe Meal cadastrado para esse periodo."
                                Height="16px" OnPageIndexChanging="PaginarDadosMeal" Width="307px"
                                PageSize="5" OnSelectedIndexChanged="GridMeal_SelectedIndexChanged">
                                <AlternatingRowStyle CssClass="alt"></AlternatingRowStyle>
                                <SelectedRowStyle CssClass="SelectedRowStyle" />
                                <Columns>

                                    <asp:BoundField DataField="S_merc_meal_id" HeaderText="ID" SortExpression="S_merc_meal_id">
                                        <HeaderStyle CssClass="invisible" />
                                        <FooterStyle CssClass="invisible" />
                                        <ItemStyle CssClass="invisible" />
                                    </asp:BoundField>

                                    <asp:BoundField DataField="S_meal_nome" HeaderText="Meal"
                                        SortExpression="S_meal_nome" />

                                    <asp:BoundField DataField="S_merc_meal_tarifa_total" HeaderText="Tarifa" SortExpression="S_merc_meal_tarifa_total" />

                                    <asp:BoundField DataField="S_mercado_tarifa_status_nome" HeaderText="Status" SortExpression="S_mercado_tarifa_status_nome" />

                                    <asp:TemplateField HeaderText="Add File">
                                        <ItemTemplate>
                                            <asp:CheckBox ID="chkAddFile" runat="server" AutoPostBack="true" OnCheckedChanged="chkAddFile_CheckedChanged" ToolTip="Se checado será adicionado no file junto com a tarifa." />
                                            <asp:Label ID="lblAddFile" runat="server" Text='<%# Eval("AddFile") %>' style="display:none" />
                                        </ItemTemplate>
                                        <HeaderStyle Wrap="False" HorizontalAlign="Center" />
                                        <ItemStyle Wrap="False" HorizontalAlign="Center" />
                                    </asp:TemplateField>

                                    <asp:CommandField ShowSelectButton="True" SelectText="Editar" ButtonType="Image" SelectImageUrl="~/images/Icones/edit.png" />

                                    <asp:TemplateField HeaderText="">
                                        <ItemTemplate>
                                            <asp:ImageButton ID="ExluirMeal" ToolTip="Excluir Meal"
                                                runat="server" CommandArgument='<%# Eval("S_merc_meal_id") %>'
                                                OnCommand="ExluirMeal"
                                                ImageUrl="~/images/Icones/delete.png" />
                                        </ItemTemplate>
                                        <HeaderStyle Wrap="False" />
                                        <ItemStyle Wrap="False" />
                                    </asp:TemplateField>

                                </Columns>

                                <PagerStyle CssClass="pgr"></PagerStyle>

                            </asp:GridView>
                        </fieldset>

                    </div>

                    <div class="FormBases">

                        <fieldset>
                            <legend>Base</legend>

                            <asp:Label ID="lblSemBaseTXT" runat="server" Text="" />

                            <asp:GridView ID="GridBases" runat="server" AutoGenerateColumns="False" CssClass="mGrid" EmptyDataText="Não existe base para este supplier." GridLines="None" Height="77px" Width="16px" OnSelectedIndexChanged="GridBases_SelectedIndexChanged">
                                <AlternatingRowStyle CssClass="alt"></AlternatingRowStyle>
                                <SelectedRowStyle CssClass="SelectedRowStyle" />
                                <Columns>
                                    <asp:BoundField DataField="Base_id" HeaderText="ID" SortExpression="Base_id">
                                        <HeaderStyle CssClass="invisible" />
                                        <FooterStyle CssClass="invisible" />
                                        <ItemStyle CssClass="invisible" />
                                    </asp:BoundField>

                                    <asp:BoundField DataField="Base_de" HeaderText="De" SortExpression="Base_de" />
                                    <asp:BoundField DataField="Base_ate" HeaderText="Para" SortExpression="Base_ate" />

                                    <asp:CommandField HeaderText="Select" ShowSelectButton="True" />

                                </Columns>

                                <PagerStyle CssClass="pgr"></PagerStyle>
                            </asp:GridView>

                        </fieldset>
                    </div>


                </div>

            </ContentTemplate>
        </asp:UpdatePanel>

    </form>
</body>
</html>
